if (gpx_version.isEmpty()) {
gpx_wversion = (char*)"1.0";
} else {
- gpx_wversion = xstrdup(gpx_version);
+ // FIXME: this is gross. The surrounding code is badly tortured by
+ // there being three concepts of "output version", each with a different
+ // data type (QString, int, char*). This section needs a rethink. For
+ // now, we stuff over the QString gpx_version into the global char *
+ // gpx_wversion without making a malloc'ed copy.
+ static char tmp[16];
+ strncpy(tmp, CSTR(gpx_version), sizeof(tmp));
+ gpx_wversion = tmp;
}
}
*/
-#include <math.h>
-#include <time.h>
-
#include "defs.h"
#include "magellan.h"
#include "gbser.h"
#endif
#include <stdlib.h>
#include <stdio.h>
+#include <math.h>
+#include <time.h>
static int bitrate = 4800;
static int wptcmtcnt;
rte_name = "Route";
rte_name += QString::number(rtenum);
} else {
- rte_name = xstrndup(ca, ce - ca);
+ rte_name = ca;
+ rte_name.truncate(ce-ca);
}
n += ((ce - ca) + 1);